<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var arr = [
        {
          name: "jack",
          age: 18,
          gender: "男"
        },
        {
          name: "jack2",
          age: 181,
          gender: "男2"
        },
        {
          name: "jack3",
          age: 183,
          gender: "男3"
        }
      ];

      //   var newArr=arr.map(item=>{
      //       return item.name
      //   })

      //   var newArr = arr.map(item => {
      //     return {
      //       name: item.name,
      //       age: item.age
      //     };
      //   });

      var newArr = arr.map(item => {
        if (item.age == 181) {
          item.name = "游游";
          return item;
        }
      });

      console.log(newArr, 33333);
    </script>
  </body>
</html>
